﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UMLDesigner
{
    public partial class ParametrosVentana : Form
    {
        Boolean modificar=false;
        public ParametrosVentana()
        {
            InitializeComponent();
            listBoxType.DataSource = DataType.types;
            
        }

        public ParametrosVentana(ParameterData p)
            : this()
        {
            modificar = true;
            textBoxName.Text = p.GetName();
            
            listBoxType.Text = p.GetType();
           
        }
        

        private void buttonCancelar_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void buttonAceptar_Click(object sender, EventArgs e)
        {
            if (!modificar)
            {
                MethodsWindow v = (MethodsWindow)Owner;
                v.AnyadirParametro(textBoxName.Text, listBoxType.Text);
            }
            else
            {

                MethodsWindow v = (MethodsWindow)Owner;
                v.ModificarParametro(textBoxName.Text, listBoxType.Text);
            }
            this.Close();
        }
    }
}
